<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'admin'], function() {
    Route::group(['namespace' => 'Admin'], function() {
        //登录、验证码、添加用户、后台
        Route::any('index', 'LoginController@index')->name('admin.login');
        Route::any('login', 'LoginController@login')->name('admin.login');
        Route::any('captcha', 'LoginController@captcha')->name('admin.captcha');
        Route::any('createuser', 'LoginController@createuser')->name('admin.createuser');
        Route::any('home', 'LoginController@home')->name('home.index');
        //用户的添加修改删除
        Route::any('user', 'LoginController@user')->name('admin.user');
        Route::any('show', 'LoginController@show')->name('admin.show');
        Route::any('deluser/{id}', 'LoginController@deluser');
        Route::any("edit/{id}",'LoginController@edit');
        Route::any('ucenter', 'LoginController@ucenter')->name('admin.ucenter');
        Route::any("update",'LoginController@update');
        Route::any('updateuser','LoginController@updateuser')->name('admin.updateuser');
        //角色的添加修改删除
        Route::any('role', 'RoleController@role')->name('admin.role');
        Route::any('add', 'RoleController@add')->name('admin.add');
        Route::any('getrole', 'RoleController@getrole')->name('admin.getrole');
        Route::any('createrole', 'RoleController@createrole')->name('createrole.index');
        Route::any('delrole/{id}', 'RoleController@delrole');
        Route::any('store', 'RoleController@store')->name('admin.store');
        Route::any("editrole/{id}",'RoleController@editrole');
        Route::any("updatero",'RoleController@updatero');
        Route::any('updaterole','RoleController@updaterole')->name('admin.updaterole');
        //权限操作的添加修改删除
        Route::any('permission', 'PermissionController@permission')->name('admin.permission');
        Route::any('getper', 'PermissionController@getper')->name('admin.getper');
        Route::any('createper', 'PermissionController@createper')->name('admin.createper');
        Route::any('storepermission', 'PermissionController@storepermission')->name('admin.storepermission');
        Route::any('delper/{id}', 'PermissionController@delper')->name('admin.delper');
        Route::any("editper/{id}",'PermissionController@editper');
        Route::any("updateper",'PermissionController@updateper')->name('admin.updateper');
        Route::any('updatepermission','PermissionController@updatepermission');
        //用户分配角色
        Route::any('userrole/{id}', 'LoginController@userrole')->name('admin.userrole');
        Route::any('usro', 'LoginController@usro')->name('admin.usro');
        Route::any('getsrole/{id}', 'LoginController@getsrole')->name('admin.getsrole');
        Route::any('showrole', 'LoginController@showrole')->name('admin.showrole');
        //角色分配权限
        Route::any('roleper/{id}', 'RoleController@roleper')->name('admin.roleper');
        Route::any('roper', 'RoleController@roper')->name('admin.roper');
        Route::any('getsper/{id}', 'RoleController@getsper')->name('admin.getsper');
        Route::any('showper/{id}', 'RoleController@showper')->name('admin.showper');
    });
});
